import type { Base, Page } from "@/api/types";
import { http } from "@/utils/http";

export type Job = Base & {
  name?: string;
  description?: string;
  status?: boolean;
};

export const getJobList = (params?: Job) => {
  return http.request<Page<Job>>("get", "/job", params);
};
export const addJob = (params?: Job) => {
  return http.request<boolean>("post", "/job", params);
};
export const updateJob = (params?: Job) => {
  return http.request<boolean>("put", "/job", params);
};
export const deleteJob = (id?: string) => {
  return http.request<boolean>("delete", "/job", { id: id });
};
